import os
import configparser

rpath=os.path.split(os.path.realpath(__file__))[0]
cpath=os.path.join(rpath,'conf.ini')
# print(cpath)

class read:
    def __init__(self):
        self.r=configparser.ConfigParser()
        self.r.read(cpath,encoding='utf-8')

    def get_crm(self,name):
        value=self.r.get('crm',name)
        return value
    def get_v(self,name):
        value=self.r.get('vbl',name)
        return value
    def get_ks(self,name):
        value=self.r.get('ksxt',name)
        return value


    # def __init__(self):
    #    #第一步.生成conf对象
    #     self.cf = configparser.ConfigParser()
    #    # 第二步.载入配置文件
    #     self.cf.read(cpath,encoding="utf-8")
    #
    # #第三步 获取【env】里面的值
    # def get_crm(self, name):
    #     value = self.cf.get("crm", name)
    #     return value
    #
    # #获取连接数据库相关信息
    # def get_crmdb(self, name):
    #     value = self.cf.get("db", name)
    #     return value

